#ifndef __PROCESSPOOL_H_
#define __PROCESSPOOL_H_

#include"tcp.h"
#include"taskqueue.h"
#include<func.h>
#include"project.h"


#define MAXCONNS 1000
#define SENDBUFFSIZE 1000
#define BUFFSIZE 1000

typedef struct{
    pthread_t * threads;
    int threadNum;
    task_queue_t queue;
}thread_pool_t,*pThread_pool_t;


typedef struct{
    int length;
    char data[BUFSIZE];
}train_t;

void * threadFunc(void*);
void threadpoolInit(thread_pool_t*,int);
void threadpoolDestroy(thread_pool_t*);
void threadpoolStart(thread_pool_t*pthreadpool);
int  transferFile(int peerfd,const char*filename);
void handlEvent(int peerfd);

#endif
